#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

typedef struct arr
{
    char words[101];
}arr;


int cmp(const void* e1, const void* e2)
{
    return strcmp( ( (arr*) e1)->words, ( (arr*)e2) -> words);
}
int main()
{
    int n = 0;
    scanf("%d", &n);
    arr word[20] = { 0 };
    int i = 0;
    for (i = 0; i < n; i++)
    {
        scanf("%s", word[i].words);
    }
    qsort(word, n, sizeof(word[0]), cmp);
    for (i = 0; i < n; i++)
    {
        printf("%s\n", word[i].words);
    }
    return 0;
}